package com.wooboo.server.ext.constants;

import java.util.HashMap;
import java.util.Map;


public class Status {
	
	public static enum Flow {
		p2003("2003","1M",1.00,1),
		p10001("10001","10M",1.00,10),
        p10003("10003","50M",3.00,50),
        //p10004("10004","100M",5.00),
        p10005("10005","200M",7.00,200);
        private String code,name;
        private Double price;
        private Integer value;
        public static final Map<String, Flow> statusMap = new HashMap<String, Flow>();
		static {
			Flow[] statu = Flow.class.getEnumConstants();
		    for(Flow s:statu ) {
		    	statusMap.put(s.code.toString(), s);
		    }
	    }
        private Flow(String code,String name,Double price,Integer value) {
            this.code = code;
            this.name=name;
            this.price=price;
            this.value=value;
        }
        public String toString(){
        	return this.code;
        }
        public String toName(){
        	return this.name;
        }
        public Double price(){
        	return this.price;
        }
        public Integer value(){
        	return this.value;
        }
        public static Flow fromValue(String value) {
		    return statusMap.get(value);
	    }
        public static String valueToName(String value){
        	Flow s = Flow.fromValue(value);
  		   return null==s?value:s.toName();
  	    }
    }
	
	
	
	
}
